package com.cf.model;

import com.cf.cache.ZCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * boot-cache-ZongService
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/17 下午 12:29
 */
@Service
public class ZongService {

    @Autowired
    private TestService testService;

    @ZCache(key = "'all'")
    public List<TestVo> all() {
        List<Test> tests = testService.haha();
        return tests.stream().map(t -> {
            return new TestVo(t.getName());
        }).collect(Collectors.toList());
    }

}
